﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace PlutoStudio.Domain.Entities.Auditing
{

    public abstract class CreationAuditedEntity : CreationAuditedEntity<int>, IEntity
    {

    }

    public abstract class CreationAuditedEntity<TKey> : CreationAuditedEntity<TKey, int>, ICreationAudited
    {

    }

    public abstract class CreationAuditedEntity<TKey, TUserKey> : Entity<TKey>, ICreationAudited<TUserKey> where TUserKey : struct
    {
        public virtual TUserKey? CreatorUserId { get; set; }

        public virtual DateTime CreationTime { get; set; }

        protected CreationAuditedEntity()
        {
            CreationTime = DateTime.Now;
        }
    }

    public abstract class CreationAuditedEntity<TKey, TUser, TUserKey> : CreationAuditedEntity<TKey, TUserKey>, ICreationAudited<TUser, TUserKey>
        where TUserKey : struct
        where TUser : IEntity<TUserKey>
    {
        public TUser CreatorUser { get; set; }
    }
}
